package com.webex.ta.hydra.gui.macro;

import com.webex.ta.hydra.core.macro.MacroDefinition;

import javax.swing.*;
import java.awt.*;

/**
 * Created by Cisco WebEx.
 * User: vegaz
 * Date: 2010-9-14
 * Time: 11:55:55
 */
public class MacroListCellRenderer extends DefaultListCellRenderer implements ListCellRenderer {
    private MacroDefinition def;

    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus );
        def = (MacroDefinition) value;
        this.setText(def.getName());
        return this;
    }
}
